package com.hdyg.sixg.adapter;

import android.support.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hdyg.sixg.R;
import com.hdyg.sixg.entry.InvestBean;
import java.util.List;

/**
 * @author CZB
 * @describe 投资钱包转出适配器
 * @time 2019/3/20 14:22
 */
public class InversTransRecordAdapter extends BaseQuickAdapter<InvestBean.DataBean, BaseViewHolder> {
    public InversTransRecordAdapter(int layoutResId, @Nullable List<InvestBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, InvestBean.DataBean item) {
        helper.setText(R.id.tv_left_top,item.getDesc());
        helper.setText(R.id.tv_left_bottom,item.getCreated_at());
        if ("1".equals(item.getType())){
            helper.setText(R.id.tv_right_center,"+"+item.getAmount());
            helper.setTextColor(R.id.tv_right_center,mContext.getResources().getColor(R.color.main_color));
        }else {
            helper.setText(R.id.tv_right_center,"-"+item.getAmount());
            helper.setTextColor(R.id.tv_right_center,mContext.getResources().getColor(R.color.yellow_FFAB3D));
        }

    }
}
